package com.czh.springboot04.aspect;


import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class LogAspect {

    @Pointcut(value = "execution(* com.czh.springboot04.service.serviceimpl.*.*(..))")
    public void pointCut(){

    }


    @Before(value = "pointCut()")
    public void before(){
        System.out.println("执行前增强");
    }

    @AfterReturning("pointCut()")
    public void afterReturning(){
        System.out.println("返回增强");
    }
    @AfterThrowing("pointCut()")
    public void afterThrowing(){
        System.out.println("异常增强");
    }

    @After("pointCut()")
    public void after(){
        System.out.println("执行后增强");
    }
}
